home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-11-10 | 4.1 KB | 154 lines | [TEXT/MPS ] |
- {***********************************************************
-
- Created: Sunday, June 6, 1993 at 3:00PM
- ADSPSecure.p
- Pascal Interface to the Macintosh Libraries
-
- Copyright Apple Computer, Inc. 1990-1993
- All rights reserved
-
- ***********************************************************}
-
-
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes:= 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT ADSPSecure;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED UsingADSPSecure}
- {$SETC UsingADSPSecure:= 1}
-
- {$I+}
- {$SETC ADSPSecureIncludes:= UsingIncludes}
- {$SETC UsingIncludes:= 1}
-
-
- {$IFC UNDEFINED UsingADSP}
- {$I $$Shell(PInterfaces)ADSP.p}
- {$ENDC}
-
- {$IFC UNDEFINED UsingFiles}
- {$I $$Shell(PInterfaces)Files.p}
- {$ENDC}
-
- {$IFC UNDEFINED UsingOCE}
- {$I OCE.p}
- {$ENDC}
-
- {$IFC UNDEFINED UsingOCEAuthDir}
- {$I OCEAuthDir.p}
- {$ENDC}
-
- {$IFC UNDEFINED UsingTypes}
- {$I $$Shell(PInterfaces)Types.p}
- {$ENDC}
-
- {$SETC UsingIncludes:= ADSPSecureIncludes}
-
-
- { New ADSP control codes }
-
- CONST
- sdspOpen = 229; { open a secure connection }
-
-
-
-
-
- {
- For secure connections, the eom field of ioParams contains two single-bit flags
- (instead of a zero/non-zero byte). They are an encrypt flag (see below), and an
- eom flag. All other bits in that field should be zero.
-
- To write an encrypted message, you must set an encrypt bit in the eom field of
- the ioParams of your write call. Note: this flag is only checked on the first
- write of a message (the first write on a connection, or the first write following
- a write with eom set.
- }
-
- dspEOMBit = 0; { set if EOM at end of write }
- dspEncryptBit = 1; { set to encrypt message }
-
-
- dspEOMMask = $1; {1<<dspEOMBit}
- dspEncryptMask = $2; {1<<dspEncryptBit}
-
-
-
-
-
- {
- Define an ADSPSecure parameter block, as used for the secure Open call.
- }
-
- sdspWorkSize = 2048; { size of ADSPSecure workspace }
-
- TYPE
- TRSecureParams = PACKED RECORD
- localCID: INTEGER; { local connection id }
- remoteCID: INTEGER; { remote connection id }
- remoteAddress: AddrBlock; { address of remote end }
- filterAddress: AddrBlock; { address filter }
- sendSeq: LONGINT; { local send sequence number }
- sendWindow: INTEGER; { send window size }
- recvSeq: LONGINT; { receive sequence number }
- attnSendSeq: LONGINT; { attention send sequence number }
- attnRecvSeq: LONGINT; { attention receive sequence number }
- ocMode: Byte; { open connection mode }
- ocInterval: Byte; { open connection request retry interval }
- ocMaximum: Byte; { open connection request retry maximum }
- secure: BOOLEAN; { --> TRUE if session was authenticated }
- sessionKey: AuthKeyPtr; { <--> encryption key for session }
- credentialsSize: LONGINT; { --> length of credentials }
- credentials: Ptr; { --> pointer to credentials }
- workspace: Ptr; { --> pointer to workspace for connection }
- { align on even boundary and length = sdspWorkSize }
- recipient: AuthIdentity; { --> identity of recipient (or initiator if active mode }
- issueTime: UTCTime; { --> when credentials were issued }
- expiry: UTCTime; { --> when credentials expiry }
- initiator: RecordIDPtr; { <-- RecordID of initiator returned here.
- Must give appropriate Buffer to hold RecordID
- (Only for passive or accept mode) }
- hasIntermediary: BOOLEAN; { <-- will be set if credentials has an intermediary }
- intermediary: RecordIDPtr; { <-- RecordID of intermediary returned here.
- (If intermediary is found in credentials
- Must give appropriate Buffer to hold RecordID
- (Only for passive or accept mode) }
- END;
-
-
-
-
- SDSPParamBlock = PACKED RECORD
- CASE INTEGER OF
- 1: (dspParamBlock: DSPParamBlock);
- 2: (qLink: QElemPtr;
- qType: INTEGER;
- ioTrap: INTEGER;
- ioCmdAddr: Ptr;
- ioCompletion: ProcPtr;
- ioResult: OSErr;
- ioNamePtr: StringPtr;
- ioVRefNum: INTEGER;
- ioCRefNum: INTEGER; { adsp driver refNum }
- csCode: INTEGER; { adsp driver control code }
- qStatus: LONGINT; { adsp internal use }
- ccbRefNum: INTEGER; { connection end refNum }
- secureParams: TRSecureParams; { dspOpenSecure }
- );
- END;
-
-
- SDSPPBPtr = ^SDSPParamBlock;
-
-
- {$ENDC} { UsingADSPSecure }
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
-